#pragma once
#include "DX2DEngine.h"
#include "v2d.h"
#include "HelpfulData.h"

enum Texture_Type {BASIC, SHEET, ANIMATION};

// Basic 2D Sprite object
// contains the necessary information to store for a single d3d texture
// ...and draw it to the screen
class Texture
{
protected:
	// graphics engine reference
	DX2DEngine* engine;
	// Texture reference
	int textureID;
	// tint of the texture
	int m_R;	// Red level
	int m_G;	// Green level
	int m_B;	// blue level
	// controls wether the image is drawn in respect to the camera
	bool m_relativeToCamera;
	// used to only show a portion of a texture
	RECT m_viewRect;
	// used to discern what inherited class of texture is being used
	// mostly for abstraction purposes in the case of Texture pointers
	Texture_Type m_type;
public:
	Texture();
	~Texture();
	virtual void release();
	void initialize(LPCWSTR fileName, bool relativeToCamera);
	void setRelativeToCamera(bool relativeToCamera) { m_relativeToCamera = relativeToCamera; }
	bool relativeToCamera() { return m_relativeToCamera; }
	void setTint(int R, int G, int B);
	virtual void setViewRect(RECT rect);
	void resetViewRect();	
	virtual void draw(V2DF pos, float rotAngle, float scale);
	int imageHeight();
	int imageWidth();
	Texture_Type getType() { return m_type; }
};